<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/



Auth::routes();

Route::get('/', 'HomeController@index');

// 闭包匿名函数
Route::group([
  'middleware' => 'auth',
  'namespace' => 'Admin',
  'prefix' => 'admin'
],
function() {
  Route::get('/', 'HomeController@index');
});


Route::group(['middleware' => 'auth', 'namespace' => 'Admin', 'prefix' => 'admin'], function() {
  Route::get('/', 'HomeController@index');
  // Route::get('article', 'ArticleController@index');
  Route::resource('article', 'ArticleController');
});

// Restful路由 "增删改查" 'photo'这里不再是url，而是指一个资源的名称，
Route::resource('photo','PhotoController');

Route::get('article/{id}', 'ArticleController@show');

Route::post('comment', 'CommentController@store');

Route::get('user/{id}','UserController@showProfile');
